<?php
	require("../inc/config-system.inc.php");	
	require("../inc/config-db.inc.php");
	require("../inc/function.inc.php");
	require("../libraries/adodb/adodb.inc.php");
	require("../libraries/adodb/session/adodb-session2.php");	
	require("../libraries/adodb/session/adodb-session2-start.php");	
	require("../libraries/phpthumb/phpthumb.class.php");	
	require("../libraries/paging/paging-output.inc.php");

	require("../inc/store_config.php");
	
	// get id for news type
	foreach ($_GET as $elementName => $value) {
		$inputSafe["g" . $elementName] = inputSafe($value); // prevent SQL injection
	}
	
	// connection database
	$objConn = ADONewConnection(DB_DRIVER); 
	$objConn->Connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
	//$objConn->debug = TRUE;
	
	
//	$sqlCommand = 'SELECT qty_color_rate_id FROM `tbl_qty_color_rate` WHERE `qty_color_rate_min` < '. $inputSafe["gtype"] .' AND `qty_color_rate_max` > '. $inputSafe["gtype"]; 
	$sqlCommand = 'SELECT qty_color_rate_id FROM `tbl_qty_color_rate` WHERE `qty_color_rate_min` <= '. $inputSafe["gtype"] .' AND `qty_color_rate_max` >= '. $inputSafe["gtype"]; 
	$recordset = $objConn->Execute($sqlCommand);

//	$splitValue = explode("-", $inputSafe["ggw"]);
    $sqlCommand = 'SELECT qty_color_name,qty_color_price, qty_color_rate_id FROM tbl_qty_color WHERE qty_color_rate_id = '. $recordset->fields["qty_color_rate_id"];
    $recordsetCompany = $objConn->Execute($sqlCommand);
//echo $sqlCommand; 
                $i = 1;
		//	echo ' <option></option>';
			while (!$recordsetCompany->EOF) { 
			echo '<option value="' .$recordsetCompany->fields["qty_color_price"] .'"> '. $recordsetCompany->fields["qty_color_name"].':'.$recordsetCompany->fields["qty_color_price"].'</option>';
			$recordsetCompany->MoveNext();
                    $i = $i + 1;
			}
//	echo $result;
	ob_end_flush();
	
?>